package br.elsa.survey.view.factories;

import javax.enterprise.inject.Model;
import javax.enterprise.inject.Produces;
import javax.faces.model.SelectItem;

import br.elsa.survey.domain.questions.Level;

@Model
public class LevelFactory {

	@Produces
	public SelectItem[] getQuestionLevels() {

		SelectItem[] items = new SelectItem[Level.values().length];
		int i = 0;
		for (Level level : Level.values()) {
			items[i++] = new SelectItem(level, level.toString());
		}
		return items;
	}
}
